<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		
	</body>
	
	<script>
/*
		function f(){
			//console.log("ok");
			f();
		}
		
		f();
*/

		function f(n){
			if(n==1) return 1;
			return 2*f(n-1) + 1;
		}
		
		//1+2+3+4+5.........+n
		//f(n) = n + f(n-1)
		
		function f(n) {
			if(n==1) return 1;
			return n + f(n-1);
		}
		
		
		
	</script>
	
</html>